From 76b8218e7596adc5704263fd7d7368941a987208 Mon Sep 17 00:00:00 2001 From: X! Date: Mon, 3 Jan 2011 20:19:51 +0000 Subject: [PATCH] Throw an exception if calling parent or self on MWFunction. --- includes/MWFunction.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/includes/MWFunction.php b/includes/MWFunction.php index 0756ad24b0..8c646f6414 100644 --- a/includes/MWFunction.php +++ b/includes/MWFunction.php @@ -30,6 +30,14 @@ class MWFunction { } } + $callback = (array) $callback; + + if( count( $callback ) == 2 && $callback[0] == 'self' || $callback[0] == 'parent' ) { + + throw new MWException( 'MWFunction cannot call self::method() or parent::method()' ); + + } + // Run autoloader (workaround for call_user_func_array bug: http://bugs.php.net/bug.php?id=51329) is_callable( $callback ); -- 2.20.1